import requests
import re
import time
def zc():
    s = requests.session()
    a = s.get('http://localhost/tinyshop/index.php?con=simple&act=reg')
    ss = re.findall("<input type='hidden' name='tiny_token_reg' value='(.*)'/>", a.text)
    key = ss[0]
    url = 'http://localhost/tinyshop/index.php?con=simple&act=reg_act'
    data = {'email': 'kx66@qq.com',
            'password': '123456',
            'repassword': '123456',
            # 'verifyCode':'aaaa',
            'tiny_token_reg': '%s' % key}
    b = s.post(url, data)
    print(b.text)

zc()
